package com.autumn.platform.dao.page;

import org.apache.ibatis.session.RowBounds;
import org.springframework.data.domain.Pageable;

public class PageableRowBounds extends RowBounds {

    private final Pageable pageable;

    private long total = -1l;

    public PageableRowBounds(Pageable pageable) {
        this.pageable = pageable;
    }

    public boolean isPaged() {
        return pageable.isPaged();
    }

    public Pageable getPageable() {
        return pageable;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    @Override
    public int getOffset() {
        return 0;
    }
}
